<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        /* 
        while 
        语法结构 while（判断条件）{
            逻辑体；
        }
        */
        let num = 0;
        while (num < 5) {
            console.log('ok');
            num++; //变化条件 防止死循环
        }
    </script>
</body>

</html>